<?php
/**
 *
 * @author roy
 * @version 
 */
require_once 'Zend/View/Interface.php';

/**
 * StatusRender helper
 *
 * @uses helper Zend_View_Helper
 */
class Zend_View_Helper_StatusRender {
	
	public $_data = array(
		'1' => array(1, 'completed', '333366'), 
		'2' => array(2, 'planned', '666699'),
		'3' => array(3, 'tentative', 'CCCCCC')
	);

	/**
	 * @return the color of the given status
	 */
	public function colorOf($id) {
		return $this->_data[$id][2];		
	}
	
	/**
	 * @return the color of the given status
	 */
	public function titleOf($id) {
		return $this->_data[$id][1];		
	}
		
	/**
	 * @var Zend_View_Interface 
	 */
	public $view;
	
	/**
	 *   
	 */
	public function statusRender($id, $isColor = false) {
		return $isColor ? $this->colorOf($id) : $this->titleOf($id);
	}
	
	/**
	 * Sets the view field 
	 * @param $view Zend_View_Interface
	 */
	public function setView(Zend_View_Interface $view) {
		$this->view = $view;
	}
}
